package org.abc.fund.controller.strategy.response;

import java.math.BigDecimal;
import lombok.Builder;
import lombok.Data;
import org.abc.fund.entity.strategy.AdjustmentDetail;

@Data
@Builder
public class AdjustmentDetailResponse {
  private String fundCode;
  private BigDecimal fromWeight;
  private BigDecimal toWeight;

  public static AdjustmentDetailResponse fromEntity(AdjustmentDetail detail) {
    if (detail == null) return null;
    return AdjustmentDetailResponse.builder()
        .fundCode(detail.getFundCode())
        .fromWeight(detail.getFromWeight())
        .toWeight(detail.getToWeight())
        .build();
  }
}
